import request from '@/utils/request.js'
import baseRequest from '../baseRequest.js'
//我的订单列表
export function getOrderPublishPage(data) {
	let baseDefaultOpts = {
		// 传入请求参数
		url: '/dms-order/getOrderPublishPage',
		method:'GET',
		data:data,
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
  return baseRequest(baseDefaultOpts)
}
export function deleteOrderById(id) {
	console.log(id)
	let baseDefaultOpts = {
		// 传入请求参数
		url: '/manage-order/deleteOrderTruly/'+parseInt(id),
		method:'DELETE',
		data:{},
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
  return baseRequest(baseDefaultOpts)
}
export function getMoodTypeList() {
	let baseDefaultOpts = {
		// 传入请求参数
		url: '/manage-order/getTypeList',
		method:'GET',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}
export function getOrderList(data) {
	let baseDefaultOpts = {
		// 传入请求参数
		url: '/manage-order/getOrderPage',
		method:'GET',
		data:data,
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}
export function gerCarList() {
	let baseDefaultOpts = {
		url: '/dms-order/dms-car-info/getCarInfo',
		// 请求接口地址
		// 传入请求参数
		method: 'GET',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
  return baseRequest(baseDefaultOpts)
}
export function gerCarInfoById(id) {
	let baseDefaultOpts = {
		url: '/dms-order/dms-car-info/getCarInfoById',
		// 请求接口地址
		// 传入请求参数
		method: 'GET',
		data: {
			"id":id
		},
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
  return baseRequest(baseDefaultOpts)
}

export function gerPublishById(id) {
	let baseDefaultOpts = {
		url: '/provide/publish-order/info/'+id,
		// 请求接口地址
		// 传入请求参数
		method: 'GET',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}
export function gerMoney(data) {
	let baseDefaultOpts = {
		url: '/demand-order/getMoney',
		// 请求接口地址
		// 传入请求参数
		data,
		method: 'GET',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}

export function pay(data) {
	let baseDefaultOpts = {
		url: '/manage-order/pay',
		// 请求接口地址
		// 传入请求参数
		data,
		method: 'POST',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}

export function commentOrder(data) {
	let baseDefaultOpts = {
		url: '/demand-order/toComment',
		// 请求接口地址
		// 传入请求参数
		data,
		method: 'GET',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}
//发布订单
export function createOrder(data) {
	let baseDefaultOpts = {
		url: '/demand-order/order',
		// 请求接口地址
		data,
		// 传入请求参数
		method: 'POST',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}
//找单
export function findOrder(data) {
	let baseDefaultOpts = {
		url: '/dms-order/findOrder',
		// 请求接口地址
		data,
		// 传入请求参数
		method: 'POST',
		// 配置请求类型
		header: {
			'X-Requested-With': 'XMLHttpRequest',
			"Accept": "application/json",
			"Content-Type": "application/json; charset=UTF-8"
		},
	}
	return baseRequest(baseDefaultOpts)
}


